package richrail.view;

import richrail.control.Logger;
import richrail.control.Observer;
import richrail.control.TrainDataProvider;
import richrail.domain.Train;
import richrail.domain.Wagon;

import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

public class ProviderStub implements TrainDataProvider {

	private final Wagon[] wagons = new Wagon[]{new Wagon("aa", 11), new Wagon("bb", 22), new Wagon("cc", 33)};
	private final Train[] trains = new Train[2];

	{
		trains[0] = new Train("train1");
		trains[0].addSeatable(wagons[1]);
		trains[1] = new Train("train2");
		trains[1].addSeatable(wagons[0]);
		trains[1].addSeatable(wagons[1]);
		trains[1].addSeatable(wagons[2]);
	}

	private Observer observer;

	@Override
	public List<Train> getTrains() {
		return Arrays.asList(trains);
	}

	@Override
	public Set<Wagon> getWagons() {
		return new LinkedHashSet<Wagon>(Arrays.asList(wagons));
	}

	@Override
	public void addTrain(String trainName) {

	}

	@Override
	public boolean deleteTrain(String trainName) {
		return false;
	}

	@Override
	public void addWagon(String wagonName, int numberOfSeats) {

	}

	@Override
	public boolean deleteWagon(String wagonName) {
		return false;
	}

	@Override
	public boolean addWagonToTrain(String wagonName, String trainName) {
		return false;
	}

	@Override
	public boolean addTrainToTrain(String trainName, String toTrainName) {
		return false;
	}

	@Override
	public int getNumberOfSeatsOfWagon(String wagonName) {
		return 0;
	}

	@Override
	public int getNumberOfSeatsOfTrain(String trainName) {
		return 0;
	}

	@Override
	public boolean removeWagonFromTrain(String wagonName, String trainName) {
		return false;
	}

	@Override
	public boolean removeTrainFromTrain(String trainName, String fromTrainName) {
		return false;
	}

	@Override
	public Logger getLogger() {
		return null;
	}


	@Override
	public void addObserver(Observer observer) {

	}

}
